package com.msy.mai.module.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.msy.mai.module.system.convert.SysDeptConvert;
import com.msy.mai.module.system.entity.domain.SysDept;
import com.msy.mai.module.system.entity.vo.SysDeptVo;
import com.msy.mai.module.system.mapper.SysDeptMapper;
import com.msy.mai.module.system.mapper.SysMenuMapper;
import com.msy.mai.module.system.service.SysDeptService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
* @author Wang
* @description 针对表【sys_dept(部门表)】的数据库操作Service实现
* @createDate 2024-10-27 19:20:41
*/
@Service
@RequiredArgsConstructor
public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
    implements SysDeptService {

    private final SysDeptMapper sysDeptMapper;


    @Override
    public SysDeptVo selectDeptById(Long id) {
        SysDept sysDept = sysDeptMapper.selectOne(
                new LambdaQueryWrapper<SysDept>()
                        .eq(SysDept::getId, id)
        );
        return sysDept == null ? null : SysDeptConvert.MAPPER.to(sysDept);
    }
}




